<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String name = (String) request.getSession().getAttribute("name");
%>

<!DOCTYPE html>
<html>
<!-- 创建考试第一步 -->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>考务管理</title>
  <style type="text/css">
      .backImg{
      background-image: url('<%=basePath%>/static/images/logo2.png');
      background-repeat: no-repeat;
      background-size: 25px 25px;
      padding-left: 30px;
      }
  </style>
    
</head>

<body>
<div id="header" class="header headbg">
    <div class="container">
        <!-- Logo -->
        <div class="logo pull-left">
            <h3 class="pc_title backImg" >在线考试系统</h3>
        </div>
        <div class="navbar-collapse pull-right nav-main-collapse collapse">
            <nav class="nav-main">
                <ul id="topMain" class="nav nav-pills nav-main">
                    <c:choose>
                        <c:when test="${role eq 'master'}">
                            <li class="dropdown"><a class="dropdown-toggle" href="<%=basePath%>type/pagedata">大类管理</a></li>
                            <li class="dropdown"><a class="dropdown-toggle" href="<%=basePath%>depository/toPage">题库管理</a></li>
                            <li class="dropdown"><a class="dropdown-toggle" href="<%=basePath%>paper/pagedata">试卷管理</a></li>
                        </c:when>
                        <c:when test="${role eq 'trainee'}">
                            <li class="dropdown"><a class="dropdown-toggle" href="<%=basePath%>sys/trainee">首页</a></li>
                        </c:when>
                        <c:otherwise>
                            <li class="dropdown"><a class="dropdown-toggle" href="<%=basePath%>sys/index">人员管理</a></li>
                            <li class="dropdown"><a class="dropdown-toggle" href="<%=basePath%>dept/unitindex">单位管理</a></li>
                            <li class="dropdown"><a class="dropdown-toggle" href="<%=basePath%>type/pagedata">大类管理</a></li>
                            <li class="dropdown"><a class="dropdown-toggle" href="<%=basePath%>depository/toPage">题库管理</a></li>
                            <li class="dropdown"><a class="dropdown-toggle" href="<%=basePath%>paper/pagedata">试卷管理</a></li>
                            <li class="dropdown"><a class="dropdown-toggle" href="<%=basePath%>exam/toExamList">考试管理</a></li>
                        </c:otherwise>
                    </c:choose>
                    <li class="dropdown mega-menu"><!-- 用户信息 -->
                        <a class="dropdown-toggle" id="dropdownMenu" href="#" data-toggle="dropdown"
                           aria-haspopup="true" aria-expanded="true">
                            <i class="glyphicon glyphicon-user"></i> <%=name%>
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu menu" aria-labelledby="dropdownMenu1">
                            <li><a href="javascript:void(0);" onclick="userInfo()">
                                <i class="glyphicon glyphicon-user"></i> 用户信息</a></li>
                            <li><a href="javascript:void(0);" onclick="logout()">
                                <i class="glyphicon glyphicon-off"></i>
                                退出登录</a></li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    function logout() {
        window.location.href = "<%=path%>/sys/logout";
    }
    function userInfo() {
        window.location.href = "<%=path%>/sys/userInfo";
    }
</script>

</html>